        
        
        var animate = appear = moveLine = null;
        $(document).ready(function(){
            if(window.history.length == 1 || window.performance.navigation.type == 1){
                animateDelayCount = 2100;
            }else{
                animateDelayCount = 550;
            }
            var animations = [];
            for(var l = 0;l < $('.ready').length;l++){
                animations.push($('.ready')[l]);
            }
            animate = setInterval(function(){
                if(beginningDelay != null){
                    beginningDelay += 10;
                    if(beginningDelay <= animateDelayCount) return false;
                }
                if(!animations.length){
                    clearInterval(animate);
                };
        
                    for(var n = 0;n < animations.length;n++){
                        var ele_top = animations[n].offsetTop;
                        var ele_h = animations[n].offsetHeight;
                        var window_h = window.innerHeight;
                        var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
                    if((/*ele_top > window_h && */
                        //
                        ele_top < window_h + scrollTop)
                        &&
                        (ele_h + ele_top >scrollTop)
                         ||
                         (ele_top < window_h && scrollTop < ele_top)
                         ||
                         (animations[n].className.indexOf('fixed') > 0)){
                            animations[n].className = animations[n].className + ' frozen';
                            animations.splice(n,1);
                            break;
                    } 
                }
            },10);
            
            var appearing = [];
            for(var m = 0;m < $('.appear').length;m++){
                appearing.push($('.appear')[m]);
            }
            appear = setInterval(function(){
                if(!appearing.length){
                    clearInterval(appear);
                };
                for(var m = 0;m < appearing.length;m++){
                    var window_h = window.innerHeight;
                    var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
                    if(appearing[m].offsetTop < scrollTop + window_h){
                            
                            var val = scrollTop + window_h - appearing[m].offsetTop;
                            appearing[m].style.opacity = (val / appearing[m].offsetHeight).toFixed(1);
                            if(val / appearing[m].offsetHeight >= 1){
                                appearing.splice(m,1);
                                break;
                            }
                            
                    }
                } 
            },10);

            
            
        }) 